package com.imay.live.helper;

import android.app.Activity;
import android.content.Context;

import com.imay.live.activity.DiscoveryRankingListActivity;
import com.imay.live.activity.SettingActivity;
import com.imay.live.activity.SystemNoticeActivity;
import com.imay.live.activity.dynamics.SearchActivity;
import com.imay.live.analytics.MobclickAgent;
import com.imay.live.R;

/**
 * Created by  nick on 2017/3/27 0027.
 * TitleBar 左右两边控件点击的处理类
 */

public class TitleBarClickHelper {
    /**
     * @param currentTabId 当前显示的tabId
     * @param tabId
     * @param context
     */
    public static void leftTitleBarClick(int currentTabId, int tabId, Activity activity) {
        if (currentTabId != tabId) {
            return;
        }
        switch (currentTabId) {
            case R.id.main_rb_discovery:
                SearchActivity.startActivity(activity);
                MobclickAgent.onEvent(activity,"feed_click_search");
                break;
            case R.id.main_rb_mine:
                SystemNoticeActivity.start(activity);
                break;
        }


    }

    public static void rightTitleBarClick(int currentTabId, int tabId, Context context) {
        if (currentTabId != tabId) {
            return;
        }
        switch (currentTabId) {
            case R.id.main_rb_discovery:
                MobclickAgent.onEvent(context,"find_click_lists");
                DiscoveryRankingListActivity.start(context);
                break;
            case R.id.main_rb_mine:
                SettingActivity.start(context);
                break;
        }

    }
}
